# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=upower
pkgver=0.99.19
pkgrel=0
pkgdesc="Power Management Services"
url="https://upower.freedesktop.org"
# s390x and riscv64 blocked by polkit
arch="all !s390x !riscv64"
license="GPL-2.0-or-later"
makedepends="
	docbook-xsl
	eudev-dev
	glib-dev
	gobject-introspection-dev
	gtk-doc
	libgudev-dev
	libxslt
	meson"
checkdepends="dbus py3-dbus py3-dbusmock py3-gobject3 py3-packaging umockdev-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://gitlab.freedesktop.org/upower/upower/-/archive/v$pkgver/upower-v$pkgver.tar.bz2"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	abuild-meson \
		-Dudevhwdbdir=/lib/udev/hwdb.d/ \
		-Dudevrulesdir=/lib/udev/rules.d \
		-Dsystemdsystemunitdir=no \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
1462a64bc642bd6c5c235742f5a8fa9e3440846d90061889b568fc0a91f7b24d56d1f5a3d33bff8d6d35f78aa8bc8c15f9c4a51a2cb40f1ee3b2a822ad60ca33  upower-v0.99.19.tar.bz2
"
